﻿@model GameSchoolApplication.ViewModels.LevelViewModel

@{
    ViewBag.Title = "Uppsetning leiks";
    Layout = "~/Views/Shared/_TeacherMore.cshtml";
}
<section class="TeacherMainContent">
<h2>Uppsetning leiks: @Model.Game.Title</h2>

<p>
    @Html.ActionLink("Skrá nýtt borð", "Create", new { gameId = Model.Game.GameId})
</p>

<table class="IndexTable">
    <tr>
        <th>
            Titill
        </th>
        <th></th>
    </tr>

@foreach (var item in Model.GameLevels) {
    <tr>
        <td>
            @item.Title
        </td>
        <td>
            @Html.ActionLink("Breyta", "Edit", new { id=item.LevelId }) |
            @Html.ActionLink("Nánar", "Details", new { id=item.LevelId })
            @if (Model.CurrentLevel != null && item.LevelId == Model.CurrentLevel.LevelId)
            { 
                using (Html.BeginForm("CloseLevel", "Level", new { id = item.LevelId }))
               {
                    
                    <input type="submit" name="submit" value="Loka borði" />    
               }
            }
        </td>
    </tr>
}

</table>
</section>